<!DOCTYPE html>
<html>
    <head>
        <title>Git演示平台，iBoxDB NoSQL与MySQL的在线性能测试</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="dist/semantic.min.css">
        <link rel="stylesheet" type="text/css" href="dist/kitchensink.css">
        <script src="dist/jquery-1.9.1.min.js"></script>
        <script src="dist/semantic.min.js"></script>
    </head>
    <body  id="sink">
        <div class="demo container">
            <br>
            <div class="ui blue secondary segment center aligned">
                <h3>Git演示平台，iBoxDB NoSQL与MySQL的在线性能测试</h3>
                10个连接，每个连接读10,000个数据，检测时间, <b>数值越小速度越快</b>
            </div>
            <div class="ui two column stackable center aligned grid segment">

                <div class="column">
                    <div class="ui blue inverted secondary segment center aligned">
                        <h3 class="ui header">
                            iBoxDB NoSQL
                        </h3>
                        <div class="ui positive message iboxdb">
                            <b>点击[测试]开始</b>
                        </div>
                        <div class="negative ui button large iboxdb">测&nbsp;试</div>
                    </div>
                </div>
                <div class="ui vertical divider">
                    VS 
                </div>
                <div class="column">
                    <div class="ui green inverted segment center aligned">
                        <h3 class="ui header">
                            MySQL
                        </h3>
                        <div class="ui positive message">

                            <b>点击[测试]开始</b>
                        </div>
                        <div class="negative ui button large">测&nbsp;试</div>
                    </div></div>
            </div>
        </div>
        <script>
            $(function () {
                $('.button').click(
                        function (e) {
                            var url = "iboxdb.jsp";
                            var msg = $('.message.iboxdb');
                            var code = '<a href="https://git.oschina.net/iboxdb/nosql-application-database/tree/master/src/main/webapp/iboxdb.jsp" target="_blank">源码</a>';

                            if (!$(e.target).hasClass('iboxdb')) {
                                url = "mysql.jsp";
                                msg = $('.message:not(.iboxdb)');
                                code = code.replace("iboxdb.jsp", "mysql.jsp");
                            }
                            function failed() {
                                msg.html('<b>服务器异常，可能服务器忙，请重试</b>');
                            }
                            function succeeded(data) {
                                var p = data.indexOf(',');
                                var t = data.substring(0, p);
                                var v = data.substring(p + 1);
                                msg.html('共用<b>' + t + 'ms</b> , 校验码' + v + code);
                            }
                            $.get(url).done(succeeded).fail(failed);
                            msg.html('测试中...');
                        }
                );
            }
            );
        </script>
    </body>

</html>
<!-- v2 -->